package com.mdd.admin.validate.order;

import com.mdd.common.validator.annotation.IDMust;
import com.mdd.common.validator.annotation.IntegerContains;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import lombok.Data;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 订单参数
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class OrderParam implements Serializable {

    private static final long serialVersionUID = 1L;

    public interface create{}
    public interface update{}
    public interface delete{}

    @IDMust(message = "id参数必传且需大于0", groups = {update.class, delete.class})
    private Long id;

    @NotNull(message = "sn参数缺失", groups = {create.class, update.class})
    @Length(max = 20, message = "sn参数不能超出20个字符", groups = {create.class, update.class})
    private String sn;

    @NotNull(message = "userId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "userId参数值不能少于0", groups = {create.class, update.class})
    private Long userId;

    @NotNull(message = "transactionId参数缺失", groups = {create.class, update.class})
    @Length(max = 40, message = "transactionId参数不能超出40个字符", groups = {create.class, update.class})
    private String transactionId;

    @NotNull(message = "staffId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "staffId参数值不能少于0", groups = {create.class, update.class})
    private Long staffId;

    @NotNull(message = "orderType参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "orderType参数值不能少于0", groups = {create.class, update.class})
    private Integer orderType;

    @NotNull(message = "orderTerminal参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "orderTerminal参数值不能少于0", groups = {create.class, update.class})
    private Integer orderTerminal;

    @NotNull(message = "orderStatus参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "orderStatus参数值不能少于0", groups = {create.class, update.class})
    private Integer orderStatus;

    @NotNull(message = "payStatus参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "payStatus参数值不能少于0", groups = {create.class, update.class})
    private Integer payStatus;

    @NotNull(message = "payWay参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "payWay参数值不能少于0", groups = {create.class, update.class})
    private Integer payWay;

    @NotNull(message = "goodsPrice参数缺失", groups = {create.class, update.class})
    private BigDecimal goodsPrice;

    @NotNull(message = "orderAmount参数缺失", groups = {create.class, update.class})
    private BigDecimal orderAmount;

    @NotNull(message = "totalAmount参数缺失", groups = {create.class, update.class})
    private BigDecimal totalAmount;

    @NotNull(message = "totalNum参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "totalNum参数值不能少于0", groups = {create.class, update.class})
    private Integer totalNum;

    @NotNull(message = "userRemark参数缺失", groups = {create.class, update.class})
    @Length(max = 0, message = "userRemark参数不能超出0个字符", groups = {create.class, update.class})
    private String userRemark;

    @NotNull(message = "orderRemarks参数缺失", groups = {create.class, update.class})
    @Length(max = 0, message = "orderRemarks参数不能超出0个字符", groups = {create.class, update.class})
    private String orderRemarks;

    @NotNull(message = "verificationCode参数缺失", groups = {create.class, update.class})
    @Length(max = 20, message = "verificationCode参数不能超出20个字符", groups = {create.class, update.class})
    private String verificationCode;

    @NotNull(message = "verificationStatus参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "verificationStatus参数值不能少于0", groups = {create.class, update.class})
    private Integer verificationStatus;

    @NotNull(message = "contact参数缺失", groups = {create.class, update.class})
    @Length(max = 255, message = "contact参数不能超出255个字符", groups = {create.class, update.class})
    private String contact;

    @NotNull(message = "mobile参数缺失", groups = {create.class, update.class})
    @Length(max = 20, message = "mobile参数不能超出20个字符", groups = {create.class, update.class})
    private String mobile;

    @NotNull(message = "provinceId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "provinceId参数值不能少于0", groups = {create.class, update.class})
    private Long provinceId;

    @NotNull(message = "cityId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "cityId参数值不能少于0", groups = {create.class, update.class})
    private Long cityId;

    @NotNull(message = "districtId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "districtId参数值不能少于0", groups = {create.class, update.class})
    private Long districtId;

    @NotNull(message = "address参数缺失", groups = {create.class, update.class})
    @Length(max = 255, message = "address参数不能超出255个字符", groups = {create.class, update.class})
    private String address;

    @NotNull(message = "isDispatch参数缺失", groups = {create.class, update.class})
    @IntegerContains(values = {0, 1}, message = "isDispatch参数值不在符合范围", groups = {create.class, update.class})
    private Integer isDispatch;

    @NotNull(message = "payTime参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "payTime参数值不能少于0", groups = {create.class, update.class})
    private Long payTime;

    @NotNull(message = "cancelTime参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "cancelTime参数值不能少于0", groups = {create.class, update.class})
    private Long cancelTime;

    @NotNull(message = "appointTimeStart参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "appointTimeStart参数值不能少于0", groups = {create.class, update.class})
    private Long appointTimeStart;

    @NotNull(message = "appointTimeEnd参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "appointTimeEnd参数值不能少于0", groups = {create.class, update.class})
    private Long appointTimeEnd;

    @NotNull(message = "finishTime参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "finishTime参数值不能少于0", groups = {create.class, update.class})
    private Long finishTime;

}
